import numpy as np

with open('数据分析.py\\iris.csv',encoding='utf8') as f:
    data = np.loadtxt(f)
    #print(data)

max_position = np.argmax(data) #最大值位置
min_position = np.argmin(data) #最小值位置
print(max_position,min_position)
max_value = max(data) #最大值
min_value = min(data) #最小值
print(max_value,min_value)
data1=sorted(data) #从小到大排序
#print(data1)
data2=np.unique(data) #去除重复值
#print(data2)

data_aver = np.mean(data) #平均值
print(data_aver)
data_var = np.var(data) #方差
print(data_var)
data_std = np.std(data) #标准差
print(data_std)
data_sum = sum(data) #累积总和
print(data_sum)
data_csum = data.cumsum() #累积求和
print(data_csum)
count = (data>5.84).sum() #统计花萼长度比平均值 5.84 高的个数
print(count)

